package com.weight.system.sysmenu.service.impl;

import com.weight.system.sysmenu.PO.SysMenuInfo;
import com.weight.system.sysmenu.service.SysMenuInfoService;
import com.weight.system.sysmenu.DAO.SysMenuInfoMapper;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import org.springframework.transaction.annotation.Transactional;
import com.weight.common.util.CommonUtils;
import lombok.extern.slf4j.Slf4j;

/**
 * 菜单信息表
 */
@Service
@Transactional
@Slf4j
public class SysMenuInfoServiceImpl implements SysMenuInfoService {

	@Autowired
	private SysMenuInfoMapper sysMenuInfoMapper;


	/**
	 * 查询菜单信息信息--条件查询
	 * @param map
	 * @return
	 */
	@Override
	public List<SysMenuInfo> findSysMenuInfoByT(Map map){
		return sysMenuInfoMapper.findSysMenuInfoByT(map);
	}

	/**
	 * 查询菜单信息信息--条件，分页查询
	 * @param currentPage
	 * @param pageSize
	 * @param map
	 * @return
	 */
	@Override
	public List<SysMenuInfo> findSysMenuInfoByPage(int currentPage,int pageSize,Map map){
		PageHelper.startPage(currentPage, pageSize);
		List<SysMenuInfo> sysMenuInfoList = sysMenuInfoMapper.findSysMenuInfoByT(map);
		return sysMenuInfoList;
	}

	/**
	 * 查询菜单信息信息--查询全部
	 * @return
	 */
	@Override
	public List<SysMenuInfo> findAll(){
		return sysMenuInfoMapper.findAll();
	}

	/**
	 * ID查询菜单信息信息
	 * @param map
	 * @return
	 */
	@Override
	public SysMenuInfo findBySysMenuInfoId(Map map){
		SysMenuInfo sysMenuInfo=sysMenuInfoMapper.findBySysMenuInfoId(map);
		CommonUtils.validateExistObj(sysMenuInfo,map);
		return sysMenuInfo;
	}

	/**
	 * ID查询菜单信息信息-批量
	 * @param sysMenuInfoIdList
	 * @return
	 */
	@Override
	public List findBySysMenuInfoIdList(List sysMenuInfoIdList){
		List idList = sysMenuInfoMapper.findBySysMenuInfoIdList(sysMenuInfoIdList);
		CommonUtils.validateExistList(idList,sysMenuInfoIdList);
		return idList;
	}

	/**
	 * 添加菜单信息
	 * @param sysMenuInfo
	 */
	@Override
	public void insertSysMenuInfo(SysMenuInfo sysMenuInfo){
		sysMenuInfoMapper.insertSysMenuInfo(sysMenuInfo);
	}

	/**
	 * 批量添加菜单信息
	 * @param sysMenuInfoList
	 */
	@Override
	public void insertSysMenuInfoBatch(List<SysMenuInfo> sysMenuInfoList){
		sysMenuInfoMapper.insertSysMenuInfoBatch(sysMenuInfoList);
	}

	/**
	 * 修改菜单信息
	 * @param sysMenuInfo
	 */
	@Override
	public void updateSysMenuInfo(SysMenuInfo sysMenuInfo){
		sysMenuInfoMapper.updateSysMenuInfo(sysMenuInfo);
	}

	/**
	 * 修改菜单信息
	 * @param sysMenuInfo
	 */
	@Override
	public void updateSysMenuInfoLimt(SysMenuInfo sysMenuInfo){
		sysMenuInfoMapper.updateSysMenuInfoLimt(sysMenuInfo);
	}

	/**
	 * 物理删除菜单信息
	 * @param map
	 */
	@Override
	public void deleteBySysMenuInfoId(Map map){
		sysMenuInfoMapper.deleteBySysMenuInfoId(map);
	}

	/**
	 * 批量物理删除菜单信息
	 * @param sysMenuInfoIdList
	 */
	@Override
	public void deleteBySysMenuInfoIdBatch(List sysMenuInfoIdList){
		sysMenuInfoMapper.deleteBySysMenuInfoIdBatch(sysMenuInfoIdList);
	}

	/**
	 * 状态删除菜单信息
	 * @param map
	 */
	@Override
	public void upDelBySysMenuInfoId(Map map){
		sysMenuInfoMapper.upDelBySysMenuInfoId(map);
	}

	/**
	 * 批量状态删除菜单信息
	 * @param sysMenuInfoList
	 */
	@Override
	public void upDelBySysMenuInfoIdBatch(Map<String, Object> map){
		sysMenuInfoMapper.upDelBySysMenuInfoIdBatch(map);
	}

}